package com.ruoyi.recycle.mapper;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.recycle.domain.HousekeepingOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * 家政订单Mapper接口
 *
 * @author ruoyi
 * @date 2022-05-22
 */
public interface HousekeepingOrderMapper extends BaseMapper<HousekeepingOrder> {
    /**
     * 查询家政订单
     *
     * @param HKOrderNo 家政订单主键
     * @return 家政订单
     */
    public HousekeepingOrder selectHousekeepingOrderById(String HKOrderNo);

    /**
     * 查询家政订单列表
     *
     * @param housekeepingOrder 家政订单
     * @return 家政订单集合
     */
    public List<HousekeepingOrder> selectHousekeepingOrderList(HousekeepingOrder housekeepingOrder);

    /**
     * 新增家政订单
     *
     * @param housekeepingOrder 家政订单
     * @return 结果
     */
    public int insertHousekeepingOrder(HousekeepingOrder housekeepingOrder);

    /**
     * 修改家政订单
     *
     * @param housekeepingOrder 家政订单
     * @return 结果
     */
    public int updateHousekeepingOrder(HousekeepingOrder housekeepingOrder);

    /**
     * 删除家政订单
     *
     * @param id 家政订单主键
     * @return 结果
     */
    public int deleteHousekeepingOrderById(Long id);

    /**
     * 批量删除家政订单
     *
     * @param HKOrderNos 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteHousekeepingOrderByIds(String[] HKOrderNos);


    @Select("select sum(practical_money) from housekeeping_order ${ew.customSqlSegment}")
    BigDecimal sumFinishedOrder(@Param(Constants.WRAPPER) LambdaQueryWrapper<HousekeepingOrder> queryWrapper);
}
